#include "perceptron.h"

#include<cstdlib>
#include <iostream>
using namespace std;

int main(int argc, char **argv)
{
	if(argc != 5)
	{
		cout << "Usage:" << endl << "perceptron.exe " << "number_of_examples(int) " 
			<< "number_of_features_per_example(int) " << "learning_rate(float)" 
			<< "filename_of_training_set"<< endl;
		
		return 0;
	}
	perceptron ptn(atoi(argv[1]), atoi(argv[2]), atof(argv[3]));
	ptn.read_training_set(argv[4]);
	ptn.training();
	ptn.print_model();
	cout << "Training completion." << endl;
	
	char* test_input, *test_output;
	test_input = new char[512];
	test_output = new char[512];
	cout << "Filename of test input: ";
	cin >> test_input;
	cout << "Filename of test output: ";
	cin >> test_output;
	ptn.test(test_input, test_output);

	return 0;
}